<!doctype html>
<html>
<head>
</head>
<body>
<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
?>

<!-- JavaScript -->
<script type="text/javascript" src="<?php echo base_url() ?>js/wufoo.js"></script>
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="<?php echo base_url() ?>css/form/form.css" media="screen, tv, projection" title="Default" />
<link rel="stylesheet" type="text/css" href="<?php echo base_url() ?>css/chosen.css" media="screen, tv, projection" title="Default" />


<div id="container">
    <?php
    //Setting Awal Value Jika Prosedur yang dilakukan adalah prosedur input biasa.
    $value = array(
        'lokasi_id'          => "",
        'error'             => "",
        'legend'            => "Form Input Lokasi",
        'info'              => "Form entri data lokasi",
        'act_form'          => "lokasi/input_lokasi/",
        'lokasi_id'          => $lokasi_id,
        'lokasi_kode'       => "",
        'lokasi_nama'        => "",
        'lokasi_keterangan'  => "",
        'lokasi_id_parent'       => ""

    );
    
    //Setting Value pada form Jika melakukan prosedur Edit terhadap data tertentu.
    if($status == "edit"){
        foreach($lokasi as $row){
            $value['lokasi_id'] = $row->LOKASI_ID;
            $value['lokasi_kode'] = $row->LOKASI_KODE;
            $value['lokasi_nama'] = $row->LOKASI_NAMA;
            $value['lokasi_keterangan'] = $row->LOKASI_KETERANGAN;
        }
        $value['legend'] = "Form Edit Lokasi";
        $value['info'] = "Form Edit Data Lokasi";
        $value['act_form'] = "lokasi/edit_lokasi/".$value['lokasi_id'];
    }//end if
    
    ?>
    <?= form_open_multipart($value["act_form"],'class="wufoo" name="form_lokasi"'); ?>
    <fieldset class="fieldset">
    <legend class="legend">
        <?= $value["legend"] ?> |
    </legend>
    
    <div class="info">
        <div><?= $value["info"] ?></div>
    </div>
    <div>
        <?= anchor(site_url('lokasi'),img(array('src'=>'images/main/38.png','border'=>'0','alt'=>'')).'Kembali ke daftar lokasi','Menampilkan halaman Daftar Lokasi'); ?>
    </div>
  

 <!-- Konten -------------------------------------------------------------------------->
 <div id="contentform">
    <ul>

        <li>
            <label class="desc">KODE LOKASI *</label>
            <div>
                <input type="text" name="lokasi_kode" class="new field" value="<?php if($value['lokasi_kode'] !='') {echo $value['lokasi_kode'];}else {echo '';}?>" required/>                         
            </div>
        </li>
        <?php echo form_error('lokasi_kode'); ?>

        <li>
            <label class="desc">NAMA LOKASI</label>
            <div>
                <input type="text" name="lokasi_nama" class="new field" value="<?php if( $value['lokasi_nama'] !='') {echo  $value['lokasi_nama'];}else {echo '';}?>" required/>                         
            </div>
        </li>
        <?php echo form_error('lokasi_nama'); ?>

        <li>
            <label class="desc">KETERANGAN </label>
            <div>
                <input type="text" name="lokasi_keterangan" class="new field" value="<?php if($value['lokasi_keterangan']!='') {echo $value['lokasi_keterangan'];}else {echo '';}?>" required/>                         
            </div>
        </li>
        <?php echo form_error('lokasi_keterangan'); ?>        
                
        <li class="buttons">
          
          <input id="submit" type="submit" value="Simpan" />
          <input id="reset" type="reset" value="Batal" />
        </li>
    </ul>
</div>
</fieldset>
<?= form_close(); ?>
</form>
</div><!--container-->
</body>
</html>